import 'package:jtsell_app/entity/cart_item_entity.dart';
import 'package:jtsell_app/entity/wechat_pay_entity.dart';
import 'package:jtsell_app/entity/goods_detail_entity.dart';
import 'package:jtsell_app/entity/mall_goods_entity.dart';
import 'package:jtsell_app/entity/user_login_entity.dart';
import 'package:jtsell_app/entity/category_entity.dart';
import 'package:jtsell_app/entity/slide_entity.dart';

class EntityFactory {
  static T generateOBJ<T>(json) {
    if (1 == 0) {
      return null;
    } else if (T.toString() == "CartItemEntity") {
      return CartItemEntity.fromJson(json) as T;
    } else if (T.toString() == "WechatPayEntity") {
      return WechatPayEntity.fromJson(json) as T;
    } else if (T.toString() == "GoodsDetailEntity") {
      return GoodsDetailEntity.fromJson(json) as T;
    } else if (T.toString() == "MallGoodsEntity") {
      return MallGoodsEntity.fromJson(json) as T;
    } else if (T.toString() == "UserLoginEntity") {
      return UserLoginEntity.fromJson(json) as T;
    } else if (T.toString() == "CategoryEntity") {
      return CategoryEntity.fromJson(json) as T;
    } else if (T.toString() == "SlideEntity") {
      return SlideEntity.fromJson(json) as T;
    } else {
      return null;
    }
  }
}